package com.lxy.demo.controller;


import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping
public class TestController {


    @RequestMapping("/test")
    @PreAuthorize("hasAuthority('test')") //spring鉴别是否有该权限
    public String test(){
        return "Hello World!";
    }



}
